<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,target-densitydpi = medium-dpi">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-touch-fullscreen" content="YES">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
    <script src="../c_modules/jquery-1.7.1.min.js"></script>
	<script src="../c/TZT.js"></script>
    <script src="js/crypto-js.js"></script>
    <script src="js/jsencrypt.js"></script>
    <script src="../common/js/commonFunction.js"></script>
    <script>
        $(function(){
            var activityTitle = decodeURIComponent(T.getUrlParameter('activityTitle'));
            commonFunction.changeTitle(activityTitle);
            T.readLocalMesg(['MOBILECODE','SOFTVERSION'],function(oLocal){
                var MOBILECODE = oLocal.MOBILECODE;
                var currentVersion = oLocal.SOFTVERSION;
                if(MOBILECODE == '' || !MOBILECODE || MOBILECODE == 'null'){
                    if(commonFunction.compareVersion(currentVersion,"3.6.3") && T.judge('ISIOS')){//大于3.6.3
                        T.fn.changeurl('http://action:11964/?url=http://action:58130/?url='+encodeURIComponent('http://action:10061/?type=9&&fullscreen=1&&tztadjustnever=1&&url=home_new/commonActivityUrl.html?activityTitle='+encodeURIComponent(activityTitle)));
                    }else{
                        T.fn.action10061('http://action:58130/?url=home_new/commonActivityUrl.html?activityTitle='+encodeURIComponent(activityTitle));
                    }
                }else{
                    var headImg = '';
                    //查询头像
                    var oSend49038 = {
                            action: '49038',
                            khh: MOBILECODE,
                            ReqlinkType:2,
                        };
                    $.getData({oSendData:oSend49038,isload:false, fnSuccess:function(result){
                            headImg = result.IMG_PATH;//上传的头像
                            setCommonActivityUrl(MOBILECODE,headImg);
                        }, oConfig: function oConfig(odata) {
                            headImg = '';
                            setCommonActivityUrl(MOBILECODE,headImg);
                        }
                    })
                }
            })
        })
        function setCommonActivityUrl(mobilecode,headImg) {
            var oSend = {
                action:'49135',
                ReqlinkType:'2',
                mobileNo:mobilecode,
                accountType:'0'
            }
            $.getData({oSendData:oSend,isload:false,fnSuccess:function(data){
                var oJson = JSON.parse(data.DATA)
                // console.log(oJson)
                getUserInfo({userId:oJson.userId},function(oData){
                    // console.log(oData);
                    var objData = {
                        'mobile': mobilecode,
                        'nickName': oData.name,
                        'headImg': headImg
                    };
                    var content = JSON.stringify(objData);

                    var oSendData = {
                        action:46200,
                        ReqLinkType:2
                    }
                    $.getData({oSendData:oSendData,fnSuccess:function(res){
                        var key = res.DESKEY;
                        //key不足24位自动以0(最小位数是0)补齐,如果多余24位,则截取前24位,后面多余则舍弃掉
                        var base64 = CryptoJS.enc.Utf8.parse(key);
                        var encrypt = CryptoJS.TripleDES.encrypt(content, base64, {
                                mode: CryptoJS.mode.ECB,  //ECB模式
                                padding: CryptoJS.pad.Pkcs7//padding处理
                            }
                        );
                        var encryptData = encodeURIComponent(encrypt.toString());
                        T.readMapMesg(['commonActivityUrl'],function(oData) {
                            var activityUrl = oData.COMMONACTIVITYURL;
                            var url = activityUrl + '&&objData=' + encryptData;
                            if (T.appversion.andriod()) {
                                T.fn.changeurl('http://action:1964/?');
                                T.fn.changeurl(url);
                            } else {
                                T.fn.changeurl(url);
                            }
                        })    
                    }})
                })
            }})
        }
        window.GoBackOnLoad = function(){

        }
    </script>
</body>
</html>